const API = require('../../pages/api/index')
const {
  typeJson
} = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist') == '' ? wx.getStorageSync('prolist') : JSON.parse(wx.getStorageSync('prolist'))







Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown: "",
    pullup: 2,
    addButton: true,
    Refresh: false,
    prolist: wx.getStorageSync('prolist') == '' ? wx.getStorageSync('prolist') : JSON.parse(wx.getStorageSync('prolist')),

    listConfig: [{
        label: '班组',
        prop: 'orgName'
      },

      {
        label: '时间',
        prop: 'confirmTime',

      }
    ],


    formConfig: [


    
      {
        label: '是否可以开工',
        prop: 'isOpen',
        jsonType: typeJson.stream,
        type: 'dropDown',
        required:true,
      },
      {
        label: '无法开工原因',
        prop: 'reason',
      },
      {
        label: '未达到开工条件，暂缓开工',
        prop: 'isDely',
      },
      {
        label: '带班领导签名',
        prop: 'classLeader',
      },
      {
        label: '带班领导签名时间',
        prop: 'classLeaderTime',
        type:"dateTime"
      }, 
      


     

    ],


    net: {

      select: {
        url: `/app/lineConfirm/getDoList`,
        method: 'post',
        data: {
          mineId: true,

        }
      },
      delete: {
        url: '/app/siteMeeting/delete',
        method: 'post',
        data: {

        }
      },
      insert: {
        url: '/app/lineConfirm/edit',
        method: 'post',
        data: {
          mineId: true,
         

        }
      },
      update: {
        url: '/app/lineConfirm/edit',
        method: 'post',
        data: {

        }
      }
    },
    showCom: true
  },




  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {


    this.setData({
      showCom: false
    })

    this.setData({
      showCom: true
    })
  },



  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh: true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh: false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})